package com.ryder.ryderschool.controller;

import com.ryder.ryderschool.common.Result;
import com.ryder.ryderschool.service.StatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/statistics")
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticsService statisticsService;

    @GetMapping("/department")
    public Result<Map<String, Object>> getDepartmentStatistics() {
        return Result.success(statisticsService.getDepartmentStatistics());
    }

    @GetMapping("/project-type")
    public Result<Map<String, Object>> getProjectTypeStatistics() {
        return Result.success(statisticsService.getProjectTypeStatistics());
    }

    @GetMapping("/yearly")
    public Result<Map<String, Object>> getYearlyStatistics() {
        return Result.success(statisticsService.getYearlyStatistics());
    }

    @GetMapping("/teacher/{teacherId}")
    public Result<Map<String, Object>> getTeacherStatistics(@PathVariable Integer teacherId) {
        return Result.success(statisticsService.getTeacherStatistics(teacherId));
    }
} 